<template>
    <div class="cancel">
        <!-- 高级查询 -->
        <el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
            <div>
                <slot name="content1"></slot>
                <slot name="content2"></slot>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="handleBtn('cancel')">取 消</el-button>
                <el-button type="primary" @click="handleBtn('confirm')">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
@Component({
    name: 'DeletionConfirmationDialog',
    components: {},
})
export default class DeletionConfirmationDialog extends Vue {
    @Prop() delConfirmationDialog;
    @Prop() title;
    // title: string = '警告'; // 标题
    dialogVisible: boolean = false;

    @Watch('delConfirmationDialog')
    watchDelConfirmationDialog(val) {
        this.dialogVisible = val;
        if (val == true) {
            
        }
    }
    @Watch('dialogVisible')
    watchDialogVisible(val) {
        if (val == false) {
            this.dialogVisible = val;
            this.$emit('emitDialogVisible', false)
        }
    }
    handleBtn(param) {
        if (param == 'cancel') {
            this.dialogVisible = false;
        } else if (param == 'confirm') {
            this.$emit('emitHandleBtn')
        }
    }
}
</script>
<style lang="scss" scoped>

</style>
